Integrand size = 29, antiderivative size = 108 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} a (4 A+3 C) x+\frac {a (3 A+2 C) \sin (c+d x)}{3 d}+\frac {a (4 A+3 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a C \cos ^2(c+d x) \sin (c+d x)}{3 d}+\frac {a C \cos ^3(c+d x) \sin (c+d x)}{4 d} \]
1/8*a*(4*A+3*C)*x+1/3*a*(3*A+2*C)*sin(d*x+c)/d+1/8*a*(4*A+3*C)*cos(d*x+c)* sin(d*x+c)/d+1/3*a*C*cos(d*x+c)^2*sin(d*x+c)/d+1/4*a*C*cos(d*x+c)^3*sin(d* x+c)/d
Time = 0.16 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.71 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {a (48 A c+36 c C+48 A d x+36 C d x+24 (4 A+3 C) \sin (c+d x)+24 (A+C) \sin (2 (c+d x))+8 C \sin (3 (c+d x))+3 C \sin (4 (c+d x)))}{96 d} \]
(a*(48*A*c + 36*c*C + 48*A*d*x + 36*C*d*x + 24*(4*A + 3*C)*Sin[c + d*x] + 24*(A + C)*Sin[2*(c + d*x)] + 8*C*Sin[3*(c + d*x)] + 3*C*Sin[4*(c + d*x)]) )/(96*d)
Time = 0.44 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.07, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3042, 3513, 3042, 3502, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) (a \cos (c+d x)+a) \left (A+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right ) \left (A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3513 |
\(\displaystyle \frac {1}{4} \int \cos (c+d x) \left (4 a C \cos ^2(c+d x)+a (4 A+3 C) \cos (c+d x)+4 a A\right )dx+\frac {a C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (4 a C \sin \left (c+d x+\frac {\pi }{2}\right )^2+a (4 A+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )+4 a A\right )dx+\frac {a C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \cos (c+d x) (4 a (3 A+2 C)+3 a (4 A+3 C) \cos (c+d x))dx+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 d}\right )+\frac {a C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (4 a (3 A+2 C)+3 a (4 A+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 d}\right )+\frac {a C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {4 a (3 A+2 C) \sin (c+d x)}{d}+\frac {3 a (4 A+3 C) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} a x (4 A+3 C)\right )+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 d}\right )+\frac {a C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
(a*C*Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + ((4*a*C*Cos[c + d*x]^2*Sin[c + d *x])/(3*d) + ((3*a*(4*A + 3*C)*x)/2 + (4*a*(3*A + 2*C)*Sin[c + d*x])/d + ( 3*a*(4*A + 3*C)*Cos[c + d*x]*Sin[c + d*x])/(2*d))/3)/4
3.1.2.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[ (-C)*d*Cos[e + f*x]*Sin[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 3) )), x] + Simp[1/(b*(m + 3)) Int[(a + b*Sin[e + f*x])^m*Simp[a*C*d + A*b*c *(m + 3) + b*d*(C*(m + 2) + A*(m + 3))*Sin[e + f*x] - (2*a*C*d - b*c*C*(m + 3))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && !LtQ[m, -1]
Time = 4.57 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.59
method | result | size |
parallelrisch | \(\frac {\left (\frac {\left (A +C \right ) \sin \left (2 d x +2 c \right )}{2}+\frac {\sin \left (3 d x +3 c \right ) C}{6}+\frac {\sin \left (4 d x +4 c \right ) C}{16}+\left (d x +2 \sin \left (d x +c \right )\right ) \left (A +\frac {3 C}{4}\right )\right ) a}{2 d}\) | \(64\) |
derivativedivides | \(\frac {a C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )}{d}\) | \(96\) |
default | \(\frac {a C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )}{d}\) | \(96\) |
risch | \(\frac {a x A}{2}+\frac {3 a C x}{8}+\frac {\sin \left (d x +c \right ) a A}{d}+\frac {3 a C \sin \left (d x +c \right )}{4 d}+\frac {a C \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) a C}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a A}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(101\) |
parts | \(\frac {\sin \left (d x +c \right ) a A}{d}+\frac {a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {a C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(104\) |
norman | \(\frac {\frac {a \left (4 A +3 C \right ) x}{8}+\frac {a \left (4 A +3 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {a \left (4 A +3 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 a \left (4 A +3 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {a \left (4 A +3 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {a \left (4 A +3 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a \left (12 A +13 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a \left (60 A +49 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {a \left (84 A +31 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(211\) |
1/2*(1/2*(A+C)*sin(2*d*x+2*c)+1/6*sin(3*d*x+3*c)*C+1/16*sin(4*d*x+4*c)*C+( d*x+2*sin(d*x+c))*(A+3/4*C))*a/d
Time = 0.26 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.70 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (4 \, A + 3 \, C\right )} a d x + {\left (6 \, C a \cos \left (d x + c\right )^{3} + 8 \, C a \cos \left (d x + c\right )^{2} + 3 \, {\left (4 \, A + 3 \, C\right )} a \cos \left (d x + c\right ) + 8 \, {\left (3 \, A + 2 \, C\right )} a\right )} \sin \left (d x + c\right )}{24 \, d} \]
1/24*(3*(4*A + 3*C)*a*d*x + (6*C*a*cos(d*x + c)^3 + 8*C*a*cos(d*x + c)^2 + 3*(4*A + 3*C)*a*cos(d*x + c) + 8*(3*A + 2*C)*a)*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (99) = 198\).
Time = 0.18 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.09 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {A a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {A a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {A a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {A a \sin {\left (c + d x \right )}}{d} + \frac {3 C a x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 C a x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 C a x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 C a \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {2 C a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {5 C a \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {C a \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + C \cos ^{2}{\left (c \right )}\right ) \left (a \cos {\left (c \right )} + a\right ) \cos {\left (c \right )} & \text {otherwise} \end {cases} \]
Piecewise((A*a*x*sin(c + d*x)**2/2 + A*a*x*cos(c + d*x)**2/2 + A*a*sin(c + d*x)*cos(c + d*x)/(2*d) + A*a*sin(c + d*x)/d + 3*C*a*x*sin(c + d*x)**4/8 + 3*C*a*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*C*a*x*cos(c + d*x)**4/8 + 3*C*a*sin(c + d*x)**3*cos(c + d*x)/(8*d) + 2*C*a*sin(c + d*x)**3/(3*d) + 5 *C*a*sin(c + d*x)*cos(c + d*x)**3/(8*d) + C*a*sin(c + d*x)*cos(c + d*x)**2 /d, Ne(d, 0)), (x*(A + C*cos(c)**2)*(a*cos(c) + a)*cos(c), True))
Time = 0.23 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.83 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a + 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C a + 96 \, A a \sin \left (d x + c\right )}{96 \, d} \]
1/96*(24*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*a - 32*(sin(d*x + c)^3 - 3*sin (d*x + c))*C*a + 3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c)) *C*a + 96*A*a*sin(d*x + c))/d
Time = 0.28 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.80 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} \, {\left (4 \, A a + 3 \, C a\right )} x + \frac {C a \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {C a \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (A a + C a\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, A a + 3 \, C a\right )} \sin \left (d x + c\right )}{4 \, d} \]
1/8*(4*A*a + 3*C*a)*x + 1/32*C*a*sin(4*d*x + 4*c)/d + 1/12*C*a*sin(3*d*x + 3*c)/d + 1/4*(A*a + C*a)*sin(2*d*x + 2*c)/d + 1/4*(4*A*a + 3*C*a)*sin(d*x + c)/d
Time = 1.95 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.96 \[ \int \cos (c+d x) (a+a \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (A\,a+\frac {3\,C\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (5\,A\,a+\frac {49\,C\,a}{12}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (7\,A\,a+\frac {31\,C\,a}{12}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (3\,A\,a+\frac {13\,C\,a}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,A+3\,C\right )}{4\,\left (A\,a+\frac {3\,C\,a}{4}\right )}\right )\,\left (4\,A+3\,C\right )}{4\,d}-\frac {a\,\left (4\,A+3\,C\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \]
(tan(c/2 + (d*x)/2)*(3*A*a + (13*C*a)/4) + tan(c/2 + (d*x)/2)^7*(A*a + (3* C*a)/4) + tan(c/2 + (d*x)/2)^3*(7*A*a + (31*C*a)/12) + tan(c/2 + (d*x)/2)^ 5*(5*A*a + (49*C*a)/12))/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d*x)/2) ^4 + 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1)) + (a*atan((a*tan( c/2 + (d*x)/2)*(4*A + 3*C))/(4*(A*a + (3*C*a)/4)))*(4*A + 3*C))/(4*d) - (a *(4*A + 3*C)*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(4*d)